package 文件操作;

import java.io.File;
import java.io.IOException;

/**
 * Created with IntelliJ IDEA.
 * Description:每个file对象都对应一个文件或者文件夹
 * User: lenovo
 * Date: 2022-10-16
 * Time: 16:12
 */
public class demo {
    public static void main(String[] args) throws IOException {
        File f = new File("D:/test.txt");//绝对路径
        System.out.println(f.getParent());
        System.out.println(f.getName());
        System.out.println(f.getPath());
        System.out.println(f.getAbsolutePath());
        System.out.println(f.getCanonicalPath());
    }
}
